<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>AUI快速完成布局</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />

</head>
<body style="background:#fff;">
<!-- <body style="background:url(./img/bg.png) top center no-repeat; background-size:cover;"> -->
    <!-- <ul class="aui-list aui-form-list">

        <li class="aui-list-item">
            <div class="aui-list-item-inner">
                <div class="aui-list-item-label">
                    账号：
                </div>
                <div class="aui-list-item-input">
                    <input type="text" placeholder="请输入手机号/账号" id="username" value="" style="border-radius:1rem;border:1px solid #ccc;">
                </div>
            </div>
        </li>
        <li class="aui-list-item">
            <div class="aui-list-item-inner">
                <div class="aui-list-item-label">
                    密码：
                </div>
                <div class="aui-list-item-input">
                    <input type="password" placeholder="请输入密码" id="password" value="">
                </div>
            </div>
        </li>


        <li class="aui-list-item">
            <div class="aui-list-item-inner aui-list-item-center aui-list-item-btn" >
                <div class="aui-btn aui-btn-info aui-margin-r-5" onclick="fnLoginIn()" >登录</div>
            </div>
        </li>
    </ul> -->

  <div style="height:12rem"></div>
    <div style="padding:2rem 0;">
        <p style="margin:1rem;"><input type="text" placeholder="请输入手机号/账号" id="username"  style="border-radius:1rem;border:1px solid #ccc;text-align:center"></p>
          <p style="margin:1rem;"><input type="password" placeholder="请输入密码" id="password" style="border-radius:1rem;border:1px solid #ccc;text-align:center"></p>
          <p style="margin:1rem;border-radius:1rem;border:1px solid #ccc;text-align:center;line-height:2rem;background:#ff4285;color:#fff;" onclick="fnLoginIn();"> 登录</p>
            <!-- <p style="margin:1rem;text-align:right;line-height:1rem;color:#ff4285;"> 忘记密码?&nbsp;&nbsp;&nbsp;&nbsp;</p> -->
    </div>

</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="./conf/config.js"></script>
<script type="text/javascript" src="./js/common.js"></script>
<script type="text/javascript" src="./conf/config.js"></script>
<script type="text/javascript" src="../script/jquery-1.8.2.min.js"></script>
<script type="text/javascript">

    function fnLoginIn() {

        var username = $("#username").val();
        var password = $("#password").val();
        api.ajax({
            url: SITE_URL+'index.php?m=api&c=appnew&a=login',
            method: 'POST',
            data: {
                values: {
                    "username": username,
                    "password": password,

                }
            }
        }, function(ret, err) {
            //判断是否登录
            //ret.status == 1
            if (ret.status == 1){
                $api.setStorage('userInfo', ret.data);
                //登录成功后，绑定淘宝账号个数存入app
                //fnGetBindTaobaoNumber(ret.data);
                api.alert({
                    title: '提示',
                    msg: '登录成功',
                }, function(ret, err) {
                    if (ret) {
                          api.openWin({
                                  name: "person_center",
                                  url: "./person_center.html",
                                  opaque: true,
                                  vScrollBarEnabled:false,
                                  reload:true
                              });

                                  api.execScript({
                                      name: 'person_center',
                                      frameName: 'person_center_frame',
                                      script: '  fnGetUserInfo(); '
                                  });



                    } else {
                        alert(JSON.stringify(err));
                    }
                });

                //登录成功后，给数据写道app中

                //然后跳转页面

            } else {
                alert(ret.msg);
            }
        });
    }
    //登录成功之后判断绑定淘宝账号的个数 如果
</script>

</html>
